//
//  REAboutViewController.m
//  录音
//
//  Created by ywy on 2016/12/23.
//  Copyright © 2016年 Wely. All rights reserved.
//

#import "REAboutViewController.h"
#import "RECheckLogin.h"
#import <SVProgressHUD/SVProgressHUD.h>
#import "RETabBarViewController.h"

@interface REAboutViewController ()

@end

@implementation REAboutViewController
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    RETabBarViewController * tabBar = (RETabBarViewController *)self.tabBarController;
    [tabBar HideTabarView:YES];
    UIImageView * firstImageView  =[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"关于我们"]];
    firstImageView.frame = CGRectMake(0, 0, 37, 17);
    self.navigationItem.titleView =firstImageView;
    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[UIImage imageNamed:@"标题阴影"]];
//    self.title = @"关于我们";
    UIBarButtonItem * rightItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(backPop)];
    self.navigationItem.leftBarButtonItem = rightItem;
    //        self.title = @"帮助与反馈";
}
-(void)backPop
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    [self requestUrl];
    // Do any additional setup after loading the view from its nib.
}
-(void)requestUrl
{
    __weak typeof(self) weakSelf = self;
    NSMutableDictionary * dict = [NSMutableDictionary new];
    dict[@"cmd"] = @"aboutMe";
    dict[@"uid"] = [UserDefaults objectForKey:@"userid"];
    [RECheckLogin POST:REBaseUrl parameters:dict progress:^(CGFloat prosser) {
        
    } success:^(id responseObject) {
        
        
        if ([responseObject[@"result"] isEqualToString:@"0"]) {
            [weakSelf.baseWebView loadRequest:[NSURLRequest  requestWithURL:[NSURL URLWithString:responseObject[@"newAboutMe"]]]];
            [SVProgressHUD dismiss];
        }else
        {
            [SVProgressHUD showErrorWithStatus:responseObject[@"resultNote"]];
        }
        
    } failure:^(NSError *error) {
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
